package coms.dto;

import java.io.Serializable;

public class User implements Serializable{

    private int id;
    private String emailAddress;
    private String password;
    private String username;
    private boolean admin;
    public Profile profile;

    public User(){

    }

    public String getEmailAddress() {
        return emailAddress;
    }

    public void setEmailAddress(String emailAddress) {
        this.emailAddress = emailAddress;
    }

    public String getPassword() {
        return password;
    }


    public void setPassword(String password) {
        this.password = password;
    }

    public Profile getProfile() {
        return profile;
    }

    public void setProfile(Profile profile) {
        this.profile = profile;
    }

    
        public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public boolean isAdmin() {
        return admin;
    }

    public void setAdmin(boolean admin) {
        this.admin = admin;
    }
    
    public String getFullname() {
        if (profile==null) return username;
        return profile.getFirstName() + " " + profile.getLastName();
    }
    
    
}